HOSTNAME=`hostname`
HOSTNAMEFQDN=`hostname -f`

cp /etc/courier/imapd.cnf /etc/courier/imapd.cnf.backup
sed -e 's/\CN=.*/CN=$HOSTNAMEFQDN/' /etc/courier/imapd.cnf.backup >/etc/courier/imapd.cnf
cp /etc/courier/pop3d.cnf /etc/courier/pop3d.cnf.backup
sed -e 's/\CN=.*/CN=$HOSTNAMEFQDN/' /etc/courier/pop3d.cnf.backup >/etc/courier/pop3d.cnf
